package mybox.engine;

public class PololuMSSC implements Figur {
	
	public File4Qcad file4qcad=null;
	double materialDicke;
	double laserBreite;
	
	QVector lowerLeft=null;
	QVector upperRight=null;
	
	Rectangle basicRectangle;
	
	public static double laenge=23.2;	
	public static double breite=22.9;
	
	public static double bfSchraubenRadius;
	
	public static double lowerLeftBFCenterX;
	public static double lowerLeftBFCentermY;
	public QVector lowerLeftBFSchraubenCenter;
	
	
	double upperRightRightBFCentermY;
	double upperRightRightBFCentermX;
	QVector upperRightBFSchraubenCenter;
	
	public static double servoAnschlussBreite;
	Rectangle servoAnschluesse;
	
	double usPowerLaenge;
	double usPowerBreite;
	Rectangle usPower;
	
	double usServoLaenge;
	double usServoBreite;
	Rectangle usServo;
	
	double usServoPowerBreite;
	double usServoPowerLaenge;
	Rectangle usServoPower;
	
	Circle befestigungCircleLowerLeft, befestigungCircleUpperRight;
	
	public PololuMSSC(File4Qcad file4qcad, QVector lowerLeft, double materialDicke, double laserBreite) {
		
	     this.file4qcad=file4qcad;
	     this.materialDicke=materialDicke;
	     this.laserBreite=laserBreite;
	     this.lowerLeft=lowerLeft;	     
	     
	     bfSchraubenRadius=1;
		 
		 
		 this.upperRight=new QVector(lowerLeft.x+laenge,lowerLeft.y+breite);			
		 basicRectangle = new Rectangle(file4qcad,lowerLeft,upperRight);
		 
		 lowerLeftBFCenterX=1;
	     lowerLeftBFCentermY=11.95;
	     lowerLeftBFSchraubenCenter = new QVector(
	    		 basicRectangle.upperLeft.x+lowerLeftBFCenterX+bfSchraubenRadius,
	    		 basicRectangle.upperLeft.y-lowerLeftBFCentermY-bfSchraubenRadius);
	     
	     upperRightRightBFCentermY=1;
	 	 upperRightRightBFCentermX=0.9;
	 	 upperRightBFSchraubenCenter = new QVector(
	 			 basicRectangle.upperRight.x-upperRightRightBFCentermX-bfSchraubenRadius,
	 			 basicRectangle.upperRight.y-upperRightRightBFCentermY-bfSchraubenRadius
	 			 );
	 	servoAnschlussBreite=7.5;
	 	servoAnschluesse = new Rectangle(file4qcad,
	 			lowerLeft, 
	 			new QVector(
	 						basicRectangle.lowerRight.x,
	 						basicRectangle.lowerRight.y+servoAnschlussBreite));
	 	
	 	usPowerLaenge=19;
		usPowerBreite=3.5;
		usPower = new Rectangle(file4qcad, 
				              new QVector(basicRectangle.upperLeft.x,basicRectangle.upperLeft.y-usPowerBreite),
				              new QVector(basicRectangle.upperLeft.x+usPowerLaenge,basicRectangle.upperRight.y)
				);
		
		usServoLaenge=laenge;
		usServoBreite=8;
		usServo = new Rectangle(file4qcad,
				                basicRectangle.lowerLeft,
				                new QVector(basicRectangle.lowerRight.x,basicRectangle.lowerRight.y+usServoBreite)
				);
		
		usServoPowerBreite=16;
		usServoPowerLaenge=3.5;
		usServoPower = new Rectangle(file4qcad,
					   new QVector(basicRectangle.lowerRight.x-usServoPowerLaenge,basicRectangle.lowerRight.y),
					   new QVector(basicRectangle.lowerRight.x,basicRectangle.lowerRight.y+usServoPowerBreite)
				);
		
		befestigungCircleLowerLeft =  new Circle(file4qcad, lowerLeftBFSchraubenCenter,bfSchraubenRadius);
		befestigungCircleUpperRight = new Circle(file4qcad, upperRightBFSchraubenCenter,bfSchraubenRadius);
		
	}
	
	public void drawBasicRectangle() {
		basicRectangle.draw();	
	}
	
	public void drawServoAnschluesse() {
		servoAnschluesse.draw();
	}
	
	
	public void draw() {				
		befestigungCircleLowerLeft.draw();		
		befestigungCircleUpperRight.draw();
		usPower.draw();
		usServo.draw();
		usServoPower.draw();
	}
	
	public void drawUsServo() {
		usServo.draw();		
	}

}
